package day12;

import java.beans.XMLEncoder;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class XMLEnc {
    public static void main(String[] args) {
        List<People> list=new ArrayList<>();
        list.add(new People("秋宏开",21,false,"六安"));
        list.add(new People("林超",25,true,"hefei"));
        list.add(new People("周一文",22,false,"合肥"));
        list.add(new People("马聪宝",21,false,"阜阳"));

        try {
            XMLEncoder xd=new XMLEncoder(new FileOutputStream("p.xml"));
            xd.writeObject(list);
            xd.close();
        } catch ( Exception e) {
            e.printStackTrace();
        }
    }
}
